/**
  * @Author: songgh
  * @Date: 2021-09-20 14:41:08
  * @LastEditors: songgh
  * @LastEditTime: 2021-09-20 15:41:08
  * @Description: typescript & vue3 示例
//   */
import * as components from './components';
import type { App } from 'vue';

export const install = function (app: App) {
    Object.keys(components).forEach(key => {
        const component = components[key];
        app.component(key,component);
    });
}

// vite 的方法导入组件
// const modules =
//   import.meta.globEager('./*.tsx');

// export default install = function (app) {
//   for (const path in modules) {
//     const mod = modules[path];
//     const compName = mod.default.name || path.replace(/^\.\/(.*)\.tsx$/, "$1");
//     const comp = mod.default;
//     app.component(compName, comp);
//   }
// }